This repository was archived by the owner on Jul 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 181
Feat/model import cmd #1248
Merged
Merged
Feat/model import cmd #1248
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
|
Need to add API for model import, to allow Jan's user import their models |
…feat/model-import-cmd
Contributor
@nguyenhoangthuan99 Will we be implementing the API as a separate issue? |
dan-menlo
approved these changes
Sep 20, 2024
Contributor
dan-menlo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm - will let @vansangpfiev @namchuai evaluate for code.
- Import API will be separate PR?
Contributor
Author
|
I added API in this PR because the logic is the same, and it makes us easier to track. |
namchuai
reviewed
Sep 20, 2024
namchuai
reviewed
Sep 20, 2024
Contributor
|
Closes #1058 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Fix #1249
Add Model Import Command to CLI
This PR introduces a new
importsubcommand to themodelscommand in our CLI application. The new functionality allows users to import GGUF (GPT-Generated Unified Format) models from local files into the application.Features
Implementation Details
The implementation consists of two main parts:
ModelImportCmdclass inmodel_import_cmd.handmodel_import_cmd.cppModelImportCmd
This class handles the core logic of importing a model:
GGUFHandlerModelConfigobject with the parsed informationYamlHandlerModelListUtilsError handling is implemented to ensure robust operation, including cleaning up partially created files in case of failures.
CLI Setup
The
importsubcommand is added to themodelscommand with the following options:--model_id: A required option to specify the unique identifier for the imported model--model_path: A required option to specify the absolute path to the GGUF model fileUsage
To import a model, users can now use the following command: